package OneDay;

import java.util.Scanner;

public class LianXi2 {
    public static void main(String[] args) {
        int num1=7,num2=29,a;
//        num1=18;
//        num2=20;
        Scanner scanner=new Scanner(System.in);
        System.out.printf("请输入第一个数");
        num1=scanner.nextInt();
        System.out.printf("请输入第二个数");
        num2=scanner.nextInt();
        System.out.printf("交换之前");
        System.out.printf("num1="+num1);
        System.out.printf("num2="+num2);
//        a=num1;
//        num1=num2;
//        num2=a;
        num1=num1+num2;
        num2=num1-num2;
        num1=num1-num2;

        System.out.printf("交换之后");
        System.out.printf("num1="+num1);
        System.out.printf("num2="+num2);
    }
}
